<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<!-- Mirrored from www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-6-callbacks.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 17 Jan 2017 13:30:16 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8" /><!-- /Added by HTTrack -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="Generator" content="iWeb 3.0.4"/>
<meta name="iWeb-Build" content="local-build-20170103"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
<meta name="viewport" content="width=770"/>
<title>wolfSSL - Docs | wolfSSL Manual - Chapter 6 (Callbacks)</title>
<link rel="stylesheet" type="text/css" media="screen,print" href="Docs-wolfssl-manual-6-callbacks_files/Docs-wolfssl-manual-6-callbacks.css"/>
<!--[if lt IE 8]><link rel='stylesheet' type='text/css' media='screen,print' href='Docs-wolfssl-manual-6-callbacks_files/Docs-wolfssl-manual-6-callbacksIE.css'/><![endif]-->
<!--[if gte IE 8]><link rel='stylesheet' type='text/css' media='screen,print' href='Media/IE8.css'/><![endif]-->
<script type="text/javascript" src="Scripts/iWebSite.js"></script>
<script type="text/javascript" src="Docs-wolfssl-manual-6-callbacks_files/Docs-wolfssl-manual-6-callbacks.js"></script>
<meta name="description" content="Description of several callbacks included in the wolfSSL embedded SSL library, including handshake and timeout callbacks."/><meta name="keywords" content="embedded ssl, ssl library, open source ssl, embedded web server, ssl callbacks, openssl alternative, openssl replacement, portable ssl, embedded tls, small openssl, smart grid, connected home, ecc, lightweight ssl, suite b, encryption security software, ssl inspection"/><meta name="robots" content="follow,index"/> <script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','../../www.google-analytics.com/analytics.js','ga');ga('create','UA-64826966-1','auto');ga('send','pageview');</script>
 
<script>//<![CDATA[
window.zEmbed||function(e,t){var n,o,d,i,s,a=[],r=document.createElement("iframe");window.zEmbed=function(){a.push(arguments)},window.zE=window.zE||window.zEmbed,r.src="javascript:false",r.title="",r.role="presentation",(r.frameElement||r).style.cssText="display: none",d=document.getElementsByTagName("script"),d=d[d.length-1],d.parentNode.insertBefore(r,d),i=r.contentWindow,s=i.document;try{o=s}catch(c){n=document.domain,r.src='javascript:var d=document.open();d.domain="'+n+'";void(0);',o=s}o.open()._l=function(){var o=this.createElement("script");n&&(this.domain=n),o.id="js-iframe-async",o.src=e,this.t=+new Date,this.zendeskHost=t,this.zEQueue=a,this.body.appendChild(o)},o.write('<body onload="document._l();">'),o.close()}("../../assets.zendesk.com/embeddable_framework/main.js","wolfssl.zendesk.com");
//]]></script>
  </head>
<body style="background: rgb(255, 255, 255); margin: 0pt; " onload="onPageLoad();">
<div style="text-align: center; ">
<div style="margin-bottom: 20px; margin-left: auto; margin-right: auto; margin-top: 20px; overflow: hidden; position: relative; word-wrap: break-word;  background: rgb(255, 255, 255); text-align: left; width: 770px; " id="body_content">
<div style="float: left; margin-left: 0px; position: relative; width: 770px; z-index: 0; " id="nav_layer">
<div style="height: 0px; line-height: 0px; " class="bumper"> </div>
<div style="clear: both; height: 0px; line-height: 0px; " class="spacer"> </div>
</div>
<div style="float: left; height: 0px; line-height: 0px; margin-left: 0px; position: relative; width: 770px; z-index: 10; " id="header_layer">
<div style="height: 0px; line-height: 0px; " class="bumper"> </div>
</div>
<div style="margin-left: 0px; position: relative; width: 770px; z-index: 5; " id="body_layer">
<div style="height: 0px; line-height: 0px; " class="bumper"> </div>
<div id="id1" style="height: 38px; left: 375px; position: absolute; top: 157px; width: 361px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_361_38" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style">wolfSSL Manual</p>
</div>
</div>
</div>
<div id="id2" style="height: 2818px; left: 35px; position: absolute; top: 281px; width: 701px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_701_2818" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-top: 0pt; " class="paragraph_style_1">Chapter 6: Callbacks<span class="style"><br/></span></p>
<p class="paragraph_style_2"><br/></p>
<p class="paragraph_style_3"><br/></p>
<p class="paragraph_style_3">6.1 HandShake Callback<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">wolfSSL (formerly CyaSSL) has an extension that allows a HandShake Callback to be set for connect or accept. This can be useful in embedded systems for debugging support when another debugger isn’t available and sniffing is impractical. To use wolfSSL HandShake Callbacks, use the extended functions, <span class="style_1">wolfSSL_connect_ex</span>() and <span class="style_1">wolfSSL_accept_ex</span>():<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_5">int wolfSSL_connect_ex(WOLFSSL*, HandShakeCallBack, TimeoutCallBack,        <br/></p>
<p class="paragraph_style_5">                      Timeval)<br/></p>
<p class="paragraph_style_5">int wolfSSL_accept_ex(WOLFSSL*, HandShakeCallBack, TimeoutCallBack, <br/></p>
<p class="paragraph_style_5">                     Timeval)<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">HandShakeCallBack is defined as:<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_5">typedef int (*HandShakeCallBack)(HandShakeInfo*);<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">HandShakeInfo is defined in <span class="style_1">wolfssl/callbacks.h</span> (which should be added to a non-standard build):<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_5">typedef struct handShakeInfo_st {<br/></p>
<p class="paragraph_style_5">    char   cipherName[MAX_CIPHERNAME_SZ + 1];  /* negotiated name */<br/></p>
<p class="paragraph_style_5">    char   packetNames[MAX_PACKETS_HANDSHAKE][MAX_PACKETNAME_SZ+1];<br/></p>
<p class="paragraph_style_5">                                          /* SSL packet names */<br/></p>
<p class="paragraph_style_5">    int    numberPackets;                 /* actual # of packets  */<br/></p>
<p class="paragraph_style_5">    int    negotiationError;              /* cipher/parameter err */<br/></p>
<p class="paragraph_style_5">} HandShakeInfo;<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">No dynamic memory is used since the maximum number of SSL packets in a handshake exchange is known. Packet names can be accessed through packetNames[idx] up to numberPackets. The callback will be called whether or not a handshake error occured.  Example usage is also in the client example.<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_3">6.2 Timeout Callback<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">The same extensions used with wolfSSL Handshake Callbacks can be used for wolfSSL Timeout Callbacks as well. These extensions can be called with either, both, or neither callbacks (Handshake and/or Timeout). TimeoutCallback is defined as:<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_5">typedef int (*TimeoutCallBack)(TimeoutInfo*);<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">Where TimeoutInfo looks like:<br/></p>
<p class="paragraph_style_4">         <br/></p>
<p class="paragraph_style_5">typedef struct timeoutInfo_st {<br/></p>
<p class="paragraph_style_5">    chartimeoutName[MAX_TIMEOUT_NAME_SZ +1]; /*timeout Name*/<br/></p>
<p class="paragraph_style_5">    int        flags;                            /* for future use*/<br/></p>
<p class="paragraph_style_5">    int        numberPackets;              /* actual # of packets */<br/></p>
<p class="paragraph_style_5">    PacketInfo packets[MAX_PACKETS_HANDSHAKE]; /* list of packets */<br/></p>
<p class="paragraph_style_5">    Timeval    timeoutValue;              /* timer that caused it */<br/></p>
<p class="paragraph_style_5">} TimeoutInfo;<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">Again, no dynamic memory is used for this structure since a maximum number of SSL packets is known for a handshake. Timeval is just a typedef for struct timeval.<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4"><span class="style_1">PacketInfo</span> is defined like this:<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_5">typedef struct packetInfo_st {<br/></p>
<p class="paragraph_style_5">       char        packetName[MAX_PACKETNAME_SZ + 1]; /* SSL name */<br/></p>
<p class="paragraph_style_5">       Timeval     timestamp;               /* when it occured*/<br/></p>
<p class="paragraph_style_5">       unsigned char value[MAX_VALUE_SZ];   /* if fits, it's here */<br/></p>
<p class="paragraph_style_5">       unsigned char* bufferValue;       /* otherwise here (non 0) */<br/></p>
<p class="paragraph_style_5">       int         valueSz;              /* sz of value or buffer */<br/></p>
<p class="paragraph_style_5">} PacketInfo;<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">Here, dynamic memory may be used. If the SSL packet can fit in value then that's where it's placed. valueSz holds the length and bufferValue is 0. If the packet is too big for value, only Certificate packets should cause this, then the packet is placed in bufferValue. valueSz still holds the size.<br/></p>
<p class="paragraph_style_4"> <br/></p>
<p class="paragraph_style_4">If memory is allocated for a Certificate packet then it is reclaimed after the callback returns. The timeout is implemented using signals, specifically SIGALRM, and is thread safe. If a previous  alarm is set of type ITIMER_REAL then it is reset, along with the correct handler, afterwards. The old timer will be time adjusted for any time wolfSSL spends processing. If an existing timer is shorter than the passed timer, the existing timer value is used. It is still reset afterwards. An existing timer that expires will be reset if has an interval associated with it. The callback will only be issued if a timeout occurs.<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">See the client example for usage.<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_6">6.3 User Atomic Record Layer Processing<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">wolfSSL provides Atomic Record Processing callbacks for users who wish to have more control over MAC/encrypt and decrypt/verify functionality during the SSL/TLS connection.<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">The user will need to define 2 functions:<br/></p>
<p class="paragraph_style_4">    1.  MAC/encrypt callback function<br/></p>
<p class="paragraph_style_4">    2.  Decrypt/verify callback function<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">These two functions are prototyped by <span class="style_1">CallbackMacEncrypt</span> and <span class="style_1">CallbackDecryptVerify</span> in <span class="style_1">ssl.h</span>:<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_5">typedef int (*CallbackMacEncrypt)(WOLFSSL* ssl, unsigned char* macOut,<br/></p>
<p class="paragraph_style_5">        const unsigned char* macIn, unsigned int macInSz,<br/></p>
<p class="paragraph_style_5">        int macContent, int macVerify, unsigned char* encOut,<br/></p>
<p class="paragraph_style_5">        const unsigned char* encIn, unsigned int encSz,<br/></p>
<p class="paragraph_style_5">        void* ctx);<br/></p>
<p class="paragraph_style_5"><br/></p>
<p class="paragraph_style_5">typedef int (*CallbackDecryptVerify)(WOLFSSL* ssl,<br/></p>
<p class="paragraph_style_5">        unsigned char* decOut, const unsigned char* decIn,<br/></p>
<p class="paragraph_style_5">        unsigned int decSz, int content, int verify,<br/></p>
<p class="paragraph_style_5">        unsigned int* padSz, void* ctx);<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">The user needs to write and register these functions per wolfSSL context (WOLFSSL_CTX) with <span class="style_1">wolfSSL_CTX_SetMacEncryptCb</span>() and <span class="style_1">wolfSSL_CTX_SetDecryptVerifyCb</span>().  <br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">The user can set a context per WOLFSSL object (session) with <span class="style_1">wolfSSL_SetMacEncryptCtx</span>() and <span class="style_1">wolfSSL_SetDecryptVerifyCtx</span>().  This context may be a pointer to any user-specified context, which will then in turn be passed back to the MAC/encrypt and decrypt/verify callbacks through the “void* ctx” parameter.<br/></p>
<p class="paragraph_style_4"><br/></p>
<ol>
<li style="line-height: 15px; padding-left: 35px; text-indent: -20px; " class="full-width" value="1">
<p style="text-indent: -20px; " class="paragraph_style_7"><span style="font-size: 12px; " class="Bullet">1.</span><span style="width: 10px; " class="inline-block"></span>Example callbacks can be found in wolfssl/test.h, under myMacEncryptCb() and myDecryptVerifyCb().  Usage can be seen in the wolfSSL example client (examples/client/client.c), when using the “-U” command line option.<br/></p>
</li>
</ol>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">To use Atomic Record Layer callbacks, wolfSSL needs to be compiled using the “--enable-atomicuser” configure option, or by defining the <span class="style_1">ATOMIC_USER</span> preprocessor flag.<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_6">6.4 Public Key Callbacks<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">wolfSSL provides Public Key callbacks for users who wish to have more control over ECC sign/verify functionality as well as RSA sign/verify and encrypt/decrypt functionality during the SSL/TLS connection.<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">The user can optionally define 6 functions:<br/></p>
<ol>
<li style="line-height: 15px; padding-left: 35px; text-indent: -20px; " class="full-width" value="1">
<p style="text-indent: -20px; " class="paragraph_style_7"><span style="font-size: 12px; " class="Bullet">1.</span><span style="width: 10px; " class="inline-block"></span>ECC sign callback<br/></p>
</li>
<li style="line-height: 15px; padding-left: 35px; text-indent: -20px; " class="full-width" value="2">
<p style="text-indent: -20px; " class="paragraph_style_7"><span style="font-size: 12px; " class="Bullet">2.</span><span style="width: 10px; " class="inline-block"></span>ECC verify callback<br/></p>
</li>
<li style="line-height: 15px; padding-left: 35px; text-indent: -20px; " class="full-width" value="3">
<p style="text-indent: -20px; " class="paragraph_style_7"><span style="font-size: 12px; " class="Bullet">3.</span><span style="width: 10px; " class="inline-block"></span>RSA sign callback<br/></p>
</li>
<li style="line-height: 15px; padding-left: 35px; text-indent: -20px; " class="full-width" value="4">
<p style="text-indent: -20px; " class="paragraph_style_7"><span style="font-size: 12px; " class="Bullet">4.</span><span style="width: 10px; " class="inline-block"></span>RSA verify callback<br/></p>
</li>
<li style="line-height: 15px; padding-left: 35px; text-indent: -20px; " class="full-width" value="5">
<p style="text-indent: -20px; " class="paragraph_style_7"><span style="font-size: 12px; " class="Bullet">5.</span><span style="width: 10px; " class="inline-block"></span>RSA encrypt callback<br/></p>
</li>
<li style="line-height: 15px; padding-left: 35px; text-indent: -20px; " class="full-width" value="6">
<p style="text-indent: -20px; " class="paragraph_style_7"><span style="font-size: 12px; " class="Bullet">6.</span><span style="width: 10px; " class="inline-block"></span>RSA decrypt callback<br/></p>
</li>
</ol>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">These two functions are prototyped by <span class="style_1">CallbackEccSign</span>, <span class="style_1">CallbackEccVerify</span>, <span class="style_1">CallbackRsaSign</span>, <span class="style_1">CallbackRsaVerify</span>, <span class="style_1">CallbackRsaEnc</span>, and <span class="style_1">CallbackRsaDec</span> in <span class="style_1">ssl.h</span>:<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_5">typedef int (*CallbackEccSign)(WOLFSSL* ssl, const unsigned char* in,<br/></p>
<p class="paragraph_style_5">    unsigned int inSz, unsigned char* out,<br/></p>
<p class="paragraph_style_5">    unsigned int* outSz, const unsigned char* keyDer,<br/></p>
<p class="paragraph_style_5">    unsigned int keySz, void* ctx);<br/></p>
<p class="paragraph_style_5"><br/></p>
<p class="paragraph_style_5">typedef int (*CallbackEccVerify)(WOLFSSL* ssl,<br/></p>
<p class="paragraph_style_5">    const unsigned char* sig, unsigned int sigSz,<br/></p>
<p class="paragraph_style_5">    const unsigned char* hash, unsigned int hashSz,<br/></p>
<p class="paragraph_style_5">    const unsigned char* keyDer, unsigned int keySz,<br/></p>
<p class="paragraph_style_5">    int* result, void* ctx);<br/></p>
<p class="paragraph_style_5"><br/></p>
<p class="paragraph_style_5">typedef int (*CallbackRsaSign)(WOLFSSL* ssl,<br/></p>
<p class="paragraph_style_5">    const unsigned char* in, unsigned int inSz,<br/></p>
<p class="paragraph_style_5">    unsigned char* out, unsigned int* outSz,<br/></p>
<p class="paragraph_style_5">    const unsigned char* keyDer, unsigned int keySz,<br/></p>
<p class="paragraph_style_5">    void* ctx);<br/></p>
<p class="paragraph_style_5"><br/></p>
<p class="paragraph_style_5">typedef int (*CallbackRsaVerify)(WOLFSSL* ssl,<br/></p>
<p class="paragraph_style_5">    unsigned char* sig, unsigned int sigSz,<br/></p>
<p class="paragraph_style_5">    unsigned char** out, const unsigned char* keyDer,<br/></p>
<p class="paragraph_style_5">    unsigned int keySz, void* ctx);<br/></p>
<p class="paragraph_style_5"><br/></p>
<p class="paragraph_style_5">typedef int (*CallbackRsaEnc)(WOLFSSL* ssl, const unsigned char* in,<br/></p>
<p class="paragraph_style_5">    unsigned int inSz, unsigned char* out,<br/></p>
<p class="paragraph_style_5">    unsigned int* outSz, const unsigned char* keyDer,<br/></p>
<p class="paragraph_style_5">    unsigned int keySz,<br/></p>
<p class="paragraph_style_5">    void* ctx);<br/></p>
<p class="paragraph_style_5"><br/></p>
<p class="paragraph_style_5">typedef int (*CallbackRsaDec)(WOLFSSL* ssl, unsigned char* in,<br/></p>
<p class="paragraph_style_5">    unsigned int inSz, unsigned char** out,<br/></p>
<p class="paragraph_style_5">    const unsigned char* keyDer, unsigned int keySz,<br/></p>
<p class="paragraph_style_5">    void* ctx);<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">The user needs to write and register these functions per wolfSSL context (WOLFSSL_CTX) with <span class="style_1">wolfSSL_CTX_SetEccSignCb</span>(), <span class="style_1">wolfSSL_CTX_SetEccVerifyCb</span>(), <span class="style_1">wolfSSL_CTX_SetRsaSignCb</span>(), <span class="style_1">wolfSSL_CTX_SetRsaVerifyCb</span>(), <span class="style_1">wolfSSL_CTX_SetRsaEncCb</span>(), and <span class="style_1">wolfSSL_CTX_SetRsaDecCb</span>().  <br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">The user can set a context per WOLFSSL object (session) with <span class="style_1">wolfSSL_SetEccSignCtx</span>(), <span class="style_1">wolfSSL_SetEccVerifyCtx</span>(), <span class="style_1">wolfSSL_SetRsaSignCtx</span>(), <span class="style_1">wolfSSL_SetRsaVerifyCtx</span>(), <span class="style_1">wolfSSL_SetRsaEncCtx</span>(), and <span class="style_1">wolfSSL_SetRsaDecCtx</span>().  These contexts may be pointers to any user-specified context, which will then in turn be passed back to the respective public key callback through the “void* ctx” parameter.<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">Example callbacks can be found in wolfssl/test.h, under <span class="style_1">myEccSignCb</span>(), <span class="style_1">myEccVerifyCb</span>(), <span class="style_1">myRsaSignCb</span>(), <span class="style_1">myRsaVerifyCb</span>(), <span class="style_1">myRsaEncCb</span>(), and <span class="style_1">myRsaDecCb</span>().  Usage can be seen in the wolfSSL example client (examples/client/client.c), when using the “-P” command line option.<br/></p>
<p class="paragraph_style_4"><br/></p>
<p class="paragraph_style_4">To use Atomic Record Layer callbacks, wolfSSL needs to be compiled using the “<span class="style_1">--enable-pkcallbacks</span>” configure option, or by defining the <span class="style_1">HAVE_PK_CALLBACKS</span> preprocessor flag.<br/></p>
</div>
</div>
</div>
<div id="id3" style="height: 24px; left: 193px; position: absolute; top: 122px; width: 268px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_268_24" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_8"><a class="class1" title="Docs.html" href="Docs.html">Docs</a> <span class="style_2">-&gt;</span> <span class="style_3">wolfSSL Manual</span></p>
</div>
</div>
</div>
<div style="height: 1px; width: 698px;  height: 1px; left: 37px; position: absolute; top: 220px; width: 698px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 698px; ">
<img src="Docs-wolfssl-manual-6-callbacks_files/shapeimage_1.jpg" alt="" style="height: 1px; left: 0px; position: absolute; top: 0px; width: 698px; "/>
</div>
</div>
<div style="height: 37px; width: 545px;  height: 37px; left: 191px; position: absolute; top: 80px; width: 545px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 545px; ">
<img src="Docs-wolfssl-manual-6-callbacks_files/shapeimage_2.png" alt="" style="height: 37px; left: 0px; position: absolute; top: 0px; width: 545px; "/>
</div>
</div>
<div id="id4" style="height: 25px; left: 200px; position: absolute; top: 84px; width: 43px; z-index: 1; " class="style_SkipStroke_1 shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_43_25" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_9"><a class="class2" title="Home.html" href="Home.html">Home</a></p>
</div>
</div>
</div>
<div id="id5" style="height: 25px; left: 365px; position: absolute; top: 84px; width: 72px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_72_25" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_10"><a class="class3" title="https://wolfssl.com/wolfSSL/download/downloadForm.php" href="https://wolfssl.com/wolfSSL/download/downloadForm.php">Download</a></p>
</div>
</div>
</div>
<div id="id6" style="height: 25px; left: 439px; position: absolute; top: 84px; width: 59px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_59_25" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_10"><a class="class4" title="License.html" href="License.html">License</a></p>
</div>
</div>
</div>
<div id="id7" style="height: 25px; left: 499px; position: absolute; top: 84px; width: 44px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_44_25" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_10"><a class="class5" title="Blog/Blog.html" href="Blog/Blog.html">Blog</a></p>
</div>
</div>
</div>
<div id="id8" style="height: 25px; left: 589px; position: absolute; top: 84px; width: 80px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_80_25" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_10"><a class="class6" title="Community.html" href="Community.html">Community</a></p>
</div>
</div>
</div>
<div style="height: 36px; width: 1px;  height: 36px; left: 245px; position: absolute; top: 81px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="Docs-wolfssl-manual-6-callbacks_files/shapeimage_3.png" alt="" style="height: 36px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
<div style="height: 37px; width: 1px;  height: 37px; left: 296px; position: absolute; top: 80px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="Docs-wolfssl-manual-6-callbacks_files/shapeimage_4.png" alt="" style="height: 37px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
<div style="height: 36px; width: 1px;  height: 36px; left: 363px; position: absolute; top: 81px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="Docs-wolfssl-manual-6-callbacks_files/shapeimage_5.png" alt="" style="height: 36px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
<div style="height: 36px; width: 1px;  height: 36px; left: 438px; position: absolute; top: 81px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="Docs-wolfssl-manual-6-callbacks_files/shapeimage_6.png" alt="" style="height: 36px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
<div style="height: 37px; width: 1px;  height: 37px; left: 498px; position: absolute; top: 80px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="Docs-wolfssl-manual-6-callbacks_files/shapeimage_7.png" alt="" style="height: 37px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
<div style="height: 37px; width: 1px;  height: 37px; left: 589px; position: absolute; top: 80px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="Docs-wolfssl-manual-6-callbacks_files/shapeimage_8.png" alt="" style="height: 37px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
<div id="id9" style="height: 25px; left: 671px; position: absolute; top: 84px; width: 61px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_61_25" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_10"><a class="class7" title="Contact.html" href="Contact.html">Contact</a></p>
</div>
</div>
</div>
<div id="id10" style="height: 25px; left: 249px; position: absolute; top: 84px; width: 44px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_44_25" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_9"><a class="class8" title="About.html" href="About.html">About</a></p>
</div>
</div>
</div>
<div style="height: 36px; width: 1px;  height: 36px; left: 670px; position: absolute; top: 81px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="Docs-wolfssl-manual-6-callbacks_files/shapeimage_9.png" alt="" style="height: 36px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
<div id="id11" style="height: 25px; left: 298px; position: absolute; top: 84px; width: 63px; z-index: 1; " class="style_SkipStroke_1 shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_63_25" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_10"><a class="class9" title="Products.html" href="Products.html">Products</a></p>
</div>
</div>
</div>
<div id="id12" style="height: 25px; left: 549px; position: absolute; top: 84px; width: 41px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_41_25" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_9"><a class="class10" title="Docs.html" href="Docs.html">Docs</a></p>
</div>
</div>
</div>
<div style="height: 37px; width: 1px;  height: 37px; left: 545px; position: absolute; top: 80px; width: 0px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 0px; ">
<img src="Docs-wolfssl-manual-6-callbacks_files/shapeimage_10.png" alt="" style="height: 37px; left: 0px; position: absolute; top: 0px; width: 1px; "/>
</div>
</div>
<div id="id13" style="height: 27px; left: 634px; position: absolute; top: 224px; width: 102px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_102_27" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_11"><a class="class11" title="Docs-wolfssl-manual-7-keys-and-certificates.html" href="Docs-wolfssl-manual-7-keys-and-certificates.html">Next Chapter</a></p>
</div>
</div>
</div>
<div id="id14" style="height: 25px; left: 35px; position: absolute; top: 224px; width: 125px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_125_25" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_12"><a class="class12" title="Docs-wolfssl-manual-5-portability.html" href="Docs-wolfssl-manual-5-portability.html">Previous Chapter</a></p>
</div>
</div>
</div>
<div id="id15" style="height: 27px; left: 59px; position: absolute; top: 190px; width: 196px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_196_27" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_13"><a class="class13" title="https://www.wolfssl.com/documentation/wolfSSL-Manual.pdf" href="https://www.wolfssl.com/documentation/wolfSSL-Manual.pdf">Download wolfSSL Manual (PDF)</a></p>
</div>
</div>
</div>
<div style="height: 22px; width: 22px;  height: 22px; left: 33px; position: absolute; top: 191px; width: 22px; z-index: 1; " class="tinyText style_SkipStroke_2">
<img src="Docs-wolfssl-manual-6-callbacks_files/PDF.png" alt="" style="border: none; height: 22px; width: 22px; "/>
</div>
<div id="id16" style="height: 25px; left: 323px; position: absolute; top: 224px; width: 125px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_125_25" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_14"><a title="Docs-wolfssl-manual-toc.html" href="Docs-wolfssl-manual-toc.html">Table of Contents</a></p>
</div>
</div>
</div>
<div style="height: 16px; width: 20px;  height: 16px; left: 706px; position: absolute; top: 51px; width: 20px; z-index: 1; " class="tinyText">
<div style="position: relative; width: 20px; ">
<img src="Docs-wolfssl-manual-6-callbacks_files/shapeimage_11.png" alt="" style="height: 16px; left: 0px; position: absolute; top: 0px; width: 20px; "/>
</div>
</div>
<div style="height: 19px; width: 19px;  height: 19px; left: 707px; position: absolute; top: 25px; width: 19px; z-index: 1; " class="tinyText style_SkipStroke_2">
<img src="Docs-wolfssl-manual-6-callbacks_files/United%20Kingdom(Great%20Britain).png" alt="" style="border: none; height: 19px; width: 19px; "/>
</div>
<div id="id17" style="height: 23px; left: 328px; position: absolute; top: 48px; width: 258px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_258_23" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_15">Questions? +1 (425) 245-8247</p>
</div>
</div>
</div>
<div style="height: 19px; width: 19px;  height: 19px; left: 685px; position: absolute; top: 25px; width: 19px; z-index: 1; " class="tinyText style_SkipStroke_2">
<a href="http://www.wolfssl.jp/" title="http://www.wolfssl.jp"><img src="Docs-wolfssl-manual-6-callbacks_files/japan.png" alt="" style="border: none; height: 19px; width: 19px; "/></a>
</div>
<div id="id18" style="height: 28px; left: 593px; position: absolute; top: 44px; width: 119px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_119_28" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_16"><a class="class14" title="https://www.wolfssl.com/forums" href="https://www.wolfssl.com/forums">Support <span class="style_4">Forums</span></a></p>
</div>
</div>
</div>
<div style="height: 121px; width: 155px;  height: 121px; left: 32px; position: absolute; top: 5px; width: 155px; z-index: 1; " class="tinyText style_SkipStroke_2">
<a href="Home.html" title="Home.html"><img src="Docs-wolfssl-manual-6-callbacks_files/wolfssl_logo.png" alt="" style="border: none; height: 121px; width: 156px; "/></a>
</div>
<div style="height: 3099px; line-height: 3099px; " class="spacer"> </div>
</div>
<div style="height: 100px; margin-left: 0px; position: relative; width: 770px; z-index: 15; " id="footer_layer">
<div style="height: 0px; line-height: 0px; " class="bumper"> </div>
<div id="id19" style="height: 27px; left: 634px; position: absolute; top: 27px; width: 102px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_102_27" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_11"><a class="class15" title="Docs-wolfssl-manual-7-keys-and-certificates.html" href="Docs-wolfssl-manual-7-keys-and-certificates.html">Next Chapter</a></p>
</div>
</div>
</div>
<div id="id20" style="height: 25px; left: 35px; position: absolute; top: 27px; width: 125px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_125_25" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_17"><a class="class16" title="Docs-wolfssl-manual-5-portability.html" href="Docs-wolfssl-manual-5-portability.html">Previous Chapter</a></p>
</div>
</div>
</div>
<div id="id21" style="height: 25px; left: 323px; position: absolute; top: 27px; width: 125px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_125_25" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_14"><a class="class17" title="Docs-wolfssl-manual-toc.html" href="Docs-wolfssl-manual-toc.html">Table of Contents</a></p>
</div>
</div>
</div>
<div id="id22" style="height: 29px; left: 35px; position: absolute; top: 65px; width: 701px; z-index: 1; " class="style_SkipStroke shape-with-text">
<div class="text-content graphic_textbox_layout_style_default_External_701_29" style="padding: 0px; ">
<div class="graphic_textbox_layout_style_default">
<p style="padding-bottom: 0pt; padding-top: 0pt; " class="paragraph_style_18">Copyright 2017 wolfSSL Inc.  All rights reserved.</p>
</div>
</div>
</div>
</div>
</div>
</div>
 </body>

<!-- Mirrored from www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-6-callbacks.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 17 Jan 2017 13:30:31 GMT -->
</html>
